package org.paraj.mapreduce.executors;

import java.util.Collection;
import java.util.UUID;

import org.paraj.mapreduce.ResultAggregator;

public interface ResultService{

    void startingTask(UUID parentId, UUID uid);
    void initializeComplexTask(UUID uid, int subtaskCount);
    void registerAggregator(UUID uid, ResultAggregator resultAggregator);
    void finishedSubtask(UUID parentTaskId, Object result);
    Collection getSubtaskResults(UUID taskId);
    void finishedTask(UUID taskId, Object aggregatedResult);

    <R> R waitForResult(UUID uid) throws InterruptedException;
    Collection waitForSubResults(UUID uid) throws InterruptedException;
}
